package com.ruoyi.project.course.select_course.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.course.select_course.mapper.CourseMapper;
import com.ruoyi.project.course.select_course.domain.Course;
import com.ruoyi.project.course.select_course.service.ICourseService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 选课Service业务层处理
 * 
 * @author yaolei
 * @date 2021-12-31
 */
@Service
public class CourseServiceImpl implements ICourseService 
{
    @Autowired
    private CourseMapper courseMapper;

    /**
     * 查询选课
     * 
     * @param courseID 选课主键
     * @return 选课
     */
    @Override
    public Course selectCourseByCourseID(Long courseID)
    {
        return courseMapper.selectCourseByCourseID(courseID);
    }

    /**
     * 查询选课列表
     * 
     * @param course 选课
     * @return 选课
     */
    @Override
    public List<Course> selectCourseList(Course course)
    {
        return courseMapper.selectCourseList(course);
    }

    /**
     * 新增选课
     * 
     * @param course 选课
     * @return 结果
     */
    @Override
    public int insertCourse(Course course)
    {
        return courseMapper.insertCourse(course);
    }

    /**
     * 修改选课
     * 
     * @param course 选课
     * @return 结果
     */
    @Override
    public int updateCourse(Course course)
    {
        return courseMapper.updateCourse(course);
    }

    /**
     * 批量删除选课
     * 
     * @param courseIDs 需要删除的选课主键
     * @return 结果
     */
    @Override
    public int deleteCourseByCourseIDs(String courseIDs)
    {
        return courseMapper.deleteCourseByCourseIDs(Convert.toStrArray(courseIDs));
    }

    /**
     * 删除选课信息
     * 
     * @param courseID 选课主键
     * @return 结果
     */
    @Override
    public int deleteCourseByCourseID(Long courseID)
    {
        return courseMapper.deleteCourseByCourseID(courseID);
    }
}
